package com.twu.biblioteca.menu;

import com.twu.biblioteca.user.User;

import java.io.IOException;

public class MembershipDetailsAuthorized extends MembershipDetails {
    private static final String PROMPT = "Enter any key to go back to main menu.";

    private final MenuInputReader reader;

    public MembershipDetailsAuthorized(String title, User user, MenuInputReader reader) {
        super(title, user);
        this.reader = reader;
    }

    @Override
    public String toString() {
        return user.getName() + "\n" + user.getPhone() + "\n" + user.getEmail() + "\n\n" + PROMPT;
    }

    @Override
    public void run() {
        try
        {
            reader.readString();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
    }
}
